//
//  UIButton + extention.swift
//  WeiBo
//
//  Created by 陈贵 on 15/9/13.
//  Copyright © 2015年 hzj. All rights reserved.
//

import UIKit

extension UIButton {
    convenience init(title:String,imageName: String, color: UIColor, fontSize: CGFloat){
        self.init()
        setTitle(title, forState: UIControlState.Normal)
        setImage(UIImage(named: imageName), forState: UIControlState.Normal)
        setTitleColor(color, forState: UIControlState.Normal)
        titleLabel?.font = UIFont.systemFontOfSize(fontSize)
    }
}

extension UIButton {
    convenience init(imageName:String){
        self.init()
        setImage(UIImage(named: imageName), forState: UIControlState.Normal)
        setImage(UIImage(named: imageName + "_highlighted"), forState: UIControlState.Highlighted)
        sizeToFit()
    }
}
